#ifndef __TOOLS_H__H_
#define __TOOLS_H__H_
#include <Windows.h>

typedef struct _FindCode
{
	UCHAR code[200];
	ULONG len;
	int offset;
	ULONG lastAddressOffset;
}FindCode, *PFindCode;

UCHAR charToHex(UCHAR * ch);

void initFindCodeStruct(PFindCode findCode,PCHAR code,ULONG offset,ULONG lastAddrOffset);
ULONG findAddressByCode(ULONG beginAddr,ULONG endAddr,PFindCode  findCode,ULONG size);



ULONG calcE8OrE9(ULONG oldAddr, ULONG newAddr);

#define  CALCJMPMACHIMECODE(XX,OO) calcE8OrE9(XX - 1,OO)

ULONG GetFunctionAddressByCodeAddress(ULONG addr);

#endif